home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text.html;
-
- import javax.swing.text.AttributeSet;
- import javax.swing.text.MutableAttributeSet;
- import javax.swing.text.html.HTML.Attribute;
- import javax.swing.text.html.HTML.Tag;
- import javax.swing.text.html.HTMLDocument.HTMLReader;
-
- class HTMLDocument$HTMLReader$HeadAction extends HTMLDocument.HTMLReader.HiddenAction {
- // $FF: synthetic field
- private final HTMLDocument.HTMLReader this$1;
-
- HTMLDocument$HTMLReader$HeadAction(HTMLDocument.HTMLReader var1) {
- super(var1);
- this.this$1 = var1;
- }
-
- public void end(HTML.Tag var1) {
- this.this$1.inHead = this.this$1.inStyle = false;
- if (this.this$1.styles != null) {
- boolean var2 = this.this$1.isStyleCSS;
- int var3 = 0;
- int var4 = this.this$1.styles.size();
-
- while(var3 < var4) {
- Object var5 = this.this$1.styles.elementAt(var3);
- if (var5 == Tag.LINK) {
- ++var3;
- this.handleLink((AttributeSet)this.this$1.styles.elementAt(var3));
- ++var3;
- } else {
- ++var3;
- String var6 = (String)this.this$1.styles.elementAt(var3);
- boolean var7 = var6 == null ? var2 : var6.equals("text/css");
-
- while(true) {
- ++var3;
- if (var3 >= var4 || !(this.this$1.styles.elementAt(var3) instanceof String)) {
- break;
- }
-
- if (var7) {
- this.this$1.addCSSRules((String)this.this$1.styles.elementAt(var3));
- }
- }
- }
- }
- }
-
- if (this.this$1.insertTag == null || this.this$1.insertTag == Tag.HEAD) {
- super.end(var1);
- }
-
- }
-
- private void handleLink(AttributeSet var1) {
- String var2 = (String)var1.getAttribute(Attribute.TYPE);
- if (var2 == null) {
- var2 = HTMLReader.access$0(this.this$1).getDefaultStyleSheetType();
- }
-
- if (var2.equals("text/css")) {
- String var3 = (String)var1.getAttribute(Attribute.REL);
- String var4 = (String)var1.getAttribute(Attribute.TITLE);
- String var5 = (String)var1.getAttribute(Attribute.MEDIA);
- if (var5 == null) {
- var5 = "all";
- } else {
- var5 = var5.toLowerCase();
- }
-
- if (var3 != null) {
- var3 = var3.toLowerCase();
- if ((var5.indexOf("all") != -1 || var5.indexOf("screen") != -1) && (var3.equals("stylesheet") || var3.equals("alternate stylesheet") && var4.equals(this.this$1.defaultStyle))) {
- this.this$1.linkCSSStyleSheet((String)var1.getAttribute(Attribute.HREF));
- }
- }
- }
-
- }
-
- boolean isEmpty(HTML.Tag var1) {
- return false;
- }
-
- public void start(HTML.Tag var1, MutableAttributeSet var2) {
- this.this$1.inHead = true;
- if (this.this$1.insertTag == null || this.this$1.insertTag == Tag.HEAD) {
- super.start(var1, var2);
- }
-
- }
- }
-